package datastructure;

//Struktur data untuk pecahan
public class Fraction {
  
  private int x,y;
  
  public Fraction (int x, int y) {
    this.x = x;
    this.y = y;
  }
  
  public int getX () {
    return x;
  }
  
  public int getY() {
    return y;
  }
  
  public double getDouble () {
    return (double)x / (double)y;
  }
  
  @Override
  public String toString() {
    return x + "/" + y;
  }
   
}
